package com.example.boot.rabbitmq.consumer.listener;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

import static com.example.boot.rabbitmq.consumer.common.MQConstant.QUEUE_NAME;

@Component
@RabbitListener(queues = QUEUE_NAME)// 监听的队列名称 TestQ2
public class MessageListener {
    @RabbitHandler
    public void process(Map<String, String> phoneMap) {
        System.out.println("boot-rabbitmq-consumer 收到消息：" + phoneMap);
    }
}
